package com.lungle.warmdiary.app.api.remote;

import com.lungle.warmdiary.app.model.Result;
import com.lungle.warmdiary.app.model.request.LoginPost;
import com.lungle.warmdiary.app.model.request.PwdResetPost;
import com.lungle.warmdiary.app.model.request.RegisterPost;
import com.lungle.warmdiary.app.model.response.Token;
import com.lungle.warmdiary.app.model.response.Update;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;

/**
 *@author sbbic
 *created at 2016/9/7 0:08
 */
public interface BaseApi {
    @GET("/mobile/update")
    Call<ResponseBody> getVersion(@Query("v") String versionCode);

    @GET("mobile/send-sms-code")
    Observable<Result> getCapture(@Query("phone") String phone, @Query("type") int type);

    @POST("mobile/signup")
    Observable<Result<Token>> register(@Body RegisterPost info);


    @POST("/mobile/reset-password")
    Observable<Result> resetPwd(@Body PwdResetPost post);

    @POST("mobile/login")
    Observable<Result<Token>> login(@Body LoginPost loginReq);


    @POST("mobile/register")
    Call<ResponseBody> registerDevice(@Field("registerid") String registerid);

    @GET("mobile/update")
    Observable<Result<Update>> checkUpdate(@Query("v") int v);

}
